﻿using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace xxl_job {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "xxl_job_log", DisableSyncStructure = true)]
	public partial class XxlJobLog {

		[JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
		public long Id { get; set; }

		/// <summary>
		/// 告警状态：0-默认、1-无需告警、2-告警成功、3-告警失败
		/// </summary>
		[JsonProperty, Column(Name = "alarm_status", DbType = "tinyint(4)")]
		public sbyte AlarmStatus { get; set; } = 0;

		/// <summary>
		/// 执行器地址，本次执行的地址
		/// </summary>
		[JsonProperty, Column(Name = "executor_address")]
		public string ExecutorAddress { get; set; }

		/// <summary>
		/// 失败重试次数
		/// </summary>
		[JsonProperty, Column(Name = "executor_fail_retry_count")]
		public int ExecutorFailRetryCount { get; set; } = 0;

		/// <summary>
		/// 执行器任务handler
		/// </summary>
		[JsonProperty, Column(Name = "executor_handler")]
		public string ExecutorHandler { get; set; }

		/// <summary>
		/// 执行器任务参数
		/// </summary>
		[JsonProperty, Column(Name = "executor_param", StringLength = 512)]
		public string ExecutorParam { get; set; }

		/// <summary>
		/// 执行器任务分片参数，格式如 1/2
		/// </summary>
		[JsonProperty, Column(Name = "executor_sharding_param", StringLength = 20)]
		public string ExecutorShardingParam { get; set; }

		/// <summary>
		/// 执行-状态
		/// </summary>
		[JsonProperty, Column(Name = "handle_code")]
		public int HandleCode { get; set; }

		/// <summary>
		/// 执行-日志
		/// </summary>
		[JsonProperty, Column(Name = "handle_msg", StringLength = -1)]
		public string HandleMsg { get; set; }

		/// <summary>
		/// 执行-时间
		/// </summary>
		[JsonProperty, Column(Name = "handle_time", DbType = "datetime")]
		public DateTime? HandleTime { get; set; }

		/// <summary>
		/// 执行器主键ID
		/// </summary>
		[JsonProperty, Column(Name = "job_group")]
		public int JobGroup { get; set; }

		/// <summary>
		/// 任务，主键ID
		/// </summary>
		[JsonProperty, Column(Name = "job_id")]
		public int JobId { get; set; }

		/// <summary>
		/// 调度-结果
		/// </summary>
		[JsonProperty, Column(Name = "trigger_code")]
		public int TriggerCode { get; set; }

		/// <summary>
		/// 调度-日志
		/// </summary>
		[JsonProperty, Column(Name = "trigger_msg", StringLength = -1)]
		public string TriggerMsg { get; set; }

		/// <summary>
		/// 调度-时间
		/// </summary>
		[JsonProperty, Column(Name = "trigger_time", DbType = "datetime")]
		public DateTime? TriggerTime { get; set; }

	}

}
